home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / SHARED.DIR / 01001_Script_shared movie script next >
Text File  |  1995-11-21  |  8KB  |  372 lines

  1. --celestial bodies shared script
  2. on startMoviexxx
  3.   put "Using STUB for startMovie Handler !!"
  4.   beep
  5.   beep
  6. end
  7.  
  8. on startMovie
  9.   --put ">>>shared startMovie" && the movieName
  10.   global gCOM --gCOM: is true if the movie is a celestial objects movie
  11.   global gSS
  12.   
  13.   if gSS then exit 
  14.   
  15.   set the keyDownScript to "checkKeyDowns"
  16.   
  17.   put char 1 of the movieName = "O" into gCOM
  18.   --setSpritesVisible
  19.   setUpCelestialObjectStuff
  20.   
  21.   pass
  22. end startMovie
  23.  
  24. on setupFixPal
  25.   
  26.   if the machineType <> 256 then
  27.     global gFixPalShared
  28.     
  29.     openxlib "FixPalette XObj"
  30.     set gFixPalShared=FixPalette(mNew, the stageLeft, the stageTop, the stageRight, the stageTop)
  31.   end if
  32.   
  33. end setupFixPal
  34.  
  35.  
  36.  
  37. on toggleHotSpots
  38.   
  39.   if the visibility of sprite 12 = 1 then
  40.     hideHotSpots
  41.   else
  42.     infoClose 
  43.     updateStage 
  44.     infoDesc 
  45.     showHotSpots
  46.   end if
  47. end toggleHotSpots
  48.  
  49.  
  50. on hideHotSpots
  51.   global gCOM
  52.   -- dmd these seem to be for the other views and info buttons
  53.   -- seem to be for hotspots and other views
  54.   global gTSEnabled
  55.   
  56.   set gTSEnabled = 0
  57.   
  58.   set the mouseDownScript to empty
  59.   
  60.   repeat with i = 12 to 21
  61.     set the visible of sprite i to not(gCOM)
  62.   end repeat
  63. end
  64.  
  65. on showHotSpots
  66.   -- dmd these seem to be for the other views and info buttons
  67.   -- seem to be for hotspots and other views
  68.   
  69.   global gLastHot, gCurLabelProp, gHotSpotList
  70.   
  71.   if voidP(gLastHot) then set gLastHot = -1
  72.   
  73.   if gLastHot <> gCurLabelProp then
  74.     
  75.     --
  76.     --
  77.     -- Update the hotspot/close up list
  78.     -- numbered 1, 2, 3 for scopes, and -1, -2, -3
  79.     -- for text
  80.     --
  81.     set gHotSpotList = [:]
  82.     set scope = 0
  83.     set text = 0
  84.     
  85.     repeat with i = 12 to 21
  86.       set cn = the castNum of sprite i
  87.       if cn = 0 then next repeat
  88.       
  89.       if the name of cast cn = "SCOPE.PIC" then
  90.         set scope = scope + 1
  91.         setAProp gHotSpotList, i, scope
  92.       else
  93.         set text = text - 1
  94.         setAProp gHotSpotList, i, text
  95.       end if
  96.     end repeat
  97.     
  98.   end if
  99.   
  100.   
  101.   repeat with i = 12 to 21
  102.     set the visible of sprite i to 1
  103.   end repeat
  104. end showHotSpots
  105.  
  106. on showButtons
  107.   -- hide the navigation buttons
  108.   repeat with i = 22 to 25
  109.     set the visibility of sprite i = 1
  110.   end repeat
  111.   set the visibility of sprite 11 = 1 -- Fiorella Button
  112. end showButtons
  113.  
  114. on hideButtons
  115.   -- hide the navigation buttons
  116.   repeat with i = 22 to 25
  117.     set the visibility of sprite i = 0
  118.   end repeat
  119.   if the castNum of sprite 11 <> 0 then
  120.     set the visibility of sprite 11 = 0 -- Fiorella Button
  121.   end if
  122.   
  123. end hideButtons
  124.  
  125.  
  126. on unHideAll
  127.   global gNavPalette, gPalCloseTIcks
  128.   global gHideAll
  129.   
  130.   if the ticks > (gPalCloseTIcks + 45) then 
  131.     set gHideAll = 0
  132.     
  133.     set the mouseDownScript to empty
  134.     
  135.     tell gNavPalette to lOpenNavPalette
  136.     
  137.     --moveToFront gNavPalette
  138.     showName
  139.     showButtons
  140.     updateStage
  141.   end if
  142.   
  143.   --repeat while the mouseDown
  144.   --end repeat
  145. end unHideAll
  146.  
  147.  
  148.  
  149. on hideAllButImage
  150.   global gHideAll, gNavPalette
  151.   
  152.   set gHideAll = 1
  153.   
  154.   hideHotSpots
  155.   infoClose
  156.   hideName
  157.   hideButtons
  158.   
  159.   --updateStage    
  160.   
  161.   --tell gNavPalette to idle    
  162.   
  163.   -- beep
  164.   set the mouseDownScript to "unHideAll"
  165.   
  166. end hideAllButImage
  167.  
  168. on hidePalette
  169.   set the mouseDownScript to "showPalette"
  170. end hidePalette
  171.  
  172. on showPalette
  173.   global gNavPalette, gPalCloseTIcks
  174.   
  175.   if the ticks > (gPalCloseTicks + 45) then 
  176.     set the mouseDownScript to empty  
  177.     tell gNavPalette to lOpenNavPalette    
  178.   end if
  179.   
  180. end showPalette
  181.  
  182.  
  183.  
  184.  
  185. on setSpritesVisible
  186.   showHotSpots  
  187.   infoOpen
  188. end setSpritesVisible
  189.  
  190. on updatePalPopUpsxxx -- moved to _NAV
  191.   global gNavPalette, gNavOffScreen
  192.   setUpView
  193.   setUpPhoto
  194.   tell the stage to setUpHotSpots  
  195.   if gNavOffScreen then tell gNavPalette to lOpenNavPalette
  196. end updatePalPopUps
  197.  
  198. on setUpHotSpots
  199.   global gNavPalette
  200.   
  201.   updateStage
  202.   
  203.   repeat with i = 12 to 21
  204.     if the castNum of sprite i > 0 then 
  205.       
  206.       set a = the castNum of sprite i
  207.       if a = 0 then next repeat
  208.       --put ">>> cast num again = " & a
  209.       --put ">>> cast 1001 enable hot spots: chan: " & i && "Frame " & the frame && ¼
  210. "castNum = " & the castNum of sprite i 
  211.       tell gNavPalette to enableHotSpots
  212.       exit 
  213.     end if
  214.   end repeat
  215.   
  216.   tell gNavPalette to disableHotSpots
  217.   --put ">>> cast 1001 disable hot spots"
  218.   
  219. end setUpHotSpots
  220.  
  221.  
  222.  
  223. on setUpPhotoxxx -- movied
  224.   global gCurLabelList, gNavPalette, gCurLabelProp
  225.   
  226.   if count(gCurLabelList) > 2 then
  227.     set lists = getAt(gCurLabelList, 3)
  228.     set photos = getAProp(lists, #PHOTOS)
  229.   end if
  230.   
  231.   tell gNavPalette to setPhotosPopUp(photos)
  232. end setUpPhoto
  233.  
  234. on setUpViewxxx -- moved to _NAV
  235.   global gNavPalette, gCurLabelProp, gLabels
  236.   global gUpdateViewsMenuP --, gLastFrame
  237.   
  238.   --put ">>>setUpView"
  239.   
  240.   if not gUpdateViewsMenuP then exit
  241.   
  242.   --set gLastFrame = -1
  243.   
  244.   --put ">>>setUpView... updating"
  245.   
  246.   --
  247.   --
  248.   -- Get the label list for the MAIN view, as this controls the views menu
  249.   --
  250.   set mainView = getMainView(string(gCurLabelProp))
  251.   --put ">>> mainView" && mainView
  252.   set MainLabelList = getAProp(gLabels, mainView)
  253.   
  254.   if count(MainlabelList) > 2 then
  255.     set lists = getAt(MainLabelList, 3)
  256.     set views = getAProp(lists, #VIEWS)
  257.   end if
  258.   
  259.   
  260.   
  261.   if voidP(views) then
  262.     set byType = 1
  263.   else if (count(views) = 1) then
  264.     set byType = 1
  265.   else
  266.     set byType = 0
  267.   end if
  268.   
  269.   if byType then    
  270.     set s = char 5 of (string(gCurLabelProp))
  271.     --    set s = string(gCurLabelProp)
  272.     --    set s = char length(s) of s
  273.     tell gNavPalette to setView(views, s)
  274.   else  
  275.     tell gNavPalette to setView(views)
  276.   end if
  277.   
  278. end setUpView
  279.  
  280. on setUpCelestialObjectStuff
  281.   global gCOM, gUpdateNavPalette
  282.   global gGlossPalette, gNavPalette, gRollOverLock
  283.   
  284.   
  285.   if gCOM then
  286.     updateStage
  287.     
  288.     if voidP(gNavPalette) then 
  289.       createNavPalette 
  290.     end if
  291.     
  292.     if the machineType = 256 then set gRollOverLock = 1
  293.     
  294.     
  295.     
  296.     
  297.     
  298.     
  299.     
  300.     hideHotSpots
  301.     infoClose
  302.     
  303.     set the visibility of sprite 48 = 0
  304.     
  305.     go to the frame + 1
  306.     
  307.     if the frame <> label((objectLabel() && "Video"))+1 then setupHistandDataEtc
  308.     
  309.     if voidP(gCOButtons) then
  310.       cursor 4
  311.       
  312.       --put ">>> buildgcobuttons"
  313.       buildgCOButtons
  314.       
  315.       --put ">>> set coglobals" 
  316.       setCOGlobals    
  317.     end if
  318.     
  319.     --put ">>> open nav palette"
  320.     set gUpdateNavPalette = 1
  321.     
  322.     openNavPalette
  323.     cursor -1
  324.     
  325.   end if
  326.   
  327. end setUpCelestialObjectStuff
  328.  
  329. on buildgCOButtons
  330. end buildgCOButtons
  331.  
  332.  
  333. on shortSB c,s
  334.   global gCOButtons
  335.   addprop gCOButtons, c, birth(script "sb",c,s)
  336. end
  337.  
  338. on shortSBscroll c,s
  339.   global gCOButtons
  340.   addprop gCOButtons, c, birth(script "sbscroll",c,s)
  341. end
  342.  
  343. on shortSBTVideo c, s
  344.   global gCOButtons
  345.   addprop gCOButtons, c, birth(script "sbtVideo", c, s)
  346. end
  347.  
  348. on shortSBT c, n, r, p, s
  349.   global gCOButtons
  350.   addprop gCOButtons, c, birth(script "sbt",n, c, r, p, s)
  351. end
  352.  
  353. on shortSBTRetrace c, n, r, p, s
  354.   global gCOButtons
  355.   addprop gCOButtons, c, birth(script "sbt-retrace",n, c, r, p, s)
  356. end
  357.  
  358. on setCOGlobals
  359.   global gCurrChan,gFirsChan,gLastChan,gPrevHilite
  360.   put 29 into gCurrChan
  361.   put 7 into gFirsChan
  362.   put 29 into gLastChan
  363.   put 0 into gPrevHilite
  364. end setCOGlobals
  365.  
  366. on exitFrame
  367.   global gCOM
  368.   if gCOM then go to the frame
  369. end exitFrame
  370.  
  371.  
  372.